package com.yoomiito.app.adapter.goods.list

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.yoomiito.app.R
import com.yoomiito.app.model.gift.GiftGoods
import com.yoomiito.app.utils.ImageLoader
import com.yoomiito.app.utils.SpannableUtils

class NewTaoBaoAdapter(data: List<GiftGoods>?) : BaseQuickAdapter<GiftGoods, BaseViewHolder>(R.layout.item_goods, data) {

    override fun convert(helper: BaseViewHolder, item: GiftGoods) {
        ImageLoader.getInstance().into(mContext, item.imageUrl, helper.getView(R.id.item_goods_img),R.drawable.goods_default)
        helper.setText(R.id.goodsTitle, item.title)
        helper.setText(R.id.tv_voucher, "¥" + item.couponPrice)
        helper.setText(R.id.goodsPrice, SpannableUtils.handlePrice(item.discountPrice))
        helper.setText(R.id.item_store_name, item.nick)
        helper.setText(R.id.item_sale_size, "月销" + SpannableUtils.saleNum(item.salesNum))
        helper.setGone(R.id.item_gift,false)
    }
}
